Skip to content

Fix Stale Local Backup Cache & Enrich Error Diagnostics#242

Open
patricioxavier8 wants to merge 1 commit into
release/2.6.6from
fix/backup-local-cache-cleanup
Open

Fix Stale Local Backup Cache & Enrich Error Diagnostics#242
patricioxavier8 wants to merge 1 commit into
release/2.6.6from
fix/backup-local-cache-cleanup

Conversation

@patricioxavier8
Copy link
Copy Markdown
Contributor

In this PR, the following changes are introduced:

  1. Local Cache Cleanup: Solves the issue where backups completed instantly with no files. Now, when removing a folder in the desktop app, its associated SyncedNode records are cleared from the local Realm database.
  2. Realm Thread-Safety: Re-structured cleanBackupLocalData to be synchronous using a thread-local Realm instance. This prevents the Realm accessed from incorrect thread crash when invoked from background threads.
  3. Database Entity Fix: Corrected a bug in SyncedNode.swift where rootBackupFolder was incorrectly initialized with the individual file URL instead of the root backup folder URL.
  4. Enriched Error Mapping: Updated Error.swift to extract context and cause inside getErrorDescription(). This improves diagnostic logs and simplifies mapping API failures.

- Fixed convenience initializer in SyncedNode.swift to correctly map rootBackupFolder URL.
- Implemented synchronous local database cleanup in BackupsService.swift to delete all synced nodes under the removed folder.
- Enriched error logging in Error.swift to output detailed failure context and root causes.
@patricioxavier8 patricioxavier8 requested a review from sg-gs as a code owner May 29, 2026 23:44
@patricioxavier8 patricioxavier8 self-assigned this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant